<?php /* Smarty version 2.6.26, created on 2016-05-02 21:41:17
         compiled from index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'js', 'index.html', 5, false),array('function', 'css', 'index.html', 7, false),array('modifier', 'truncate_d', 'index.html', 62, false),array('modifier', 'color', 'index.html', 66, false),)), $this); ?>
<!--引入共用头部-->
	<?php ob_start();
$_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./top.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
$this->assign('b', ob_get_contents()); ob_end_clean();
 ?>
	<?php echo $this->_tpl_vars['b']; ?>

	<!--引入js文件-->
	<?php echo smarty_function_js(array('file' => "./template/index.js"), $this);?>

	<!--引入css文件-->
	<?php echo smarty_function_css(array('file' => './template/css.css'), $this);?>

		<h2 style="color: red;">欢迎使用smarty</h2>
		<table border="2">
			<tr>
				<td>aid</td>
				<td>标题</td>
				<td>内容</td>
				<td>点击次数</td>
			</tr>
			<?php unset($this->_sections['n']);
$this->_sections['n']['loop'] = is_array($_loop=$this->_tpl_vars['data']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['n']['name'] = 'n';
$this->_sections['n']['show'] = true;
$this->_sections['n']['max'] = $this->_sections['n']['loop'];
$this->_sections['n']['step'] = 1;
$this->_sections['n']['start'] = $this->_sections['n']['step'] > 0 ? 0 : $this->_sections['n']['loop']-1;
if ($this->_sections['n']['show']) {
    $this->_sections['n']['total'] = $this->_sections['n']['loop'];
    if ($this->_sections['n']['total'] == 0)
        $this->_sections['n']['show'] = false;
} else
    $this->_sections['n']['total'] = 0;
if ($this->_sections['n']['show']):

            for ($this->_sections['n']['index'] = $this->_sections['n']['start'], $this->_sections['n']['iteration'] = 1;
                 $this->_sections['n']['iteration'] <= $this->_sections['n']['total'];
                 $this->_sections['n']['index'] += $this->_sections['n']['step'], $this->_sections['n']['iteration']++):
$this->_sections['n']['rownum'] = $this->_sections['n']['iteration'];
$this->_sections['n']['index_prev'] = $this->_sections['n']['index'] - $this->_sections['n']['step'];
$this->_sections['n']['index_next'] = $this->_sections['n']['index'] + $this->_sections['n']['step'];
$this->_sections['n']['first']      = ($this->_sections['n']['iteration'] == 1);
$this->_sections['n']['last']       = ($this->_sections['n']['iteration'] == $this->_sections['n']['total']);
?>
				<?php if ($this->_sections['n']['first']): ?>
					<tr style="color:red">
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['did']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['title']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['content']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['click']; ?>
</td>
					</tr>
				<?php else: ?>
					<tr>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['did']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['title']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['content']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['click']; ?>
</td>
					</tr>
				<?php endif; ?>
			<?php endfor; endif; ?>
		</table>
		<hr />
		<table border="2">
			<tr>
				<td>aid</td>
				<td>标题</td>
				<td>内容</td>
				<td>点击次数</td>
			</tr>
			<?php unset($this->_sections['n']);
$this->_sections['n']['loop'] = is_array($_loop=$this->_tpl_vars['data']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['n']['name'] = 'n';
$this->_sections['n']['show'] = true;
$this->_sections['n']['max'] = $this->_sections['n']['loop'];
$this->_sections['n']['step'] = 1;
$this->_sections['n']['start'] = $this->_sections['n']['step'] > 0 ? 0 : $this->_sections['n']['loop']-1;
if ($this->_sections['n']['show']) {
    $this->_sections['n']['total'] = $this->_sections['n']['loop'];
    if ($this->_sections['n']['total'] == 0)
        $this->_sections['n']['show'] = false;
} else
    $this->_sections['n']['total'] = 0;
if ($this->_sections['n']['show']):

            for ($this->_sections['n']['index'] = $this->_sections['n']['start'], $this->_sections['n']['iteration'] = 1;
                 $this->_sections['n']['iteration'] <= $this->_sections['n']['total'];
                 $this->_sections['n']['index'] += $this->_sections['n']['step'], $this->_sections['n']['iteration']++):
$this->_sections['n']['rownum'] = $this->_sections['n']['iteration'];
$this->_sections['n']['index_prev'] = $this->_sections['n']['index'] - $this->_sections['n']['step'];
$this->_sections['n']['index_next'] = $this->_sections['n']['index'] + $this->_sections['n']['step'];
$this->_sections['n']['first']      = ($this->_sections['n']['iteration'] == 1);
$this->_sections['n']['last']       = ($this->_sections['n']['iteration'] == $this->_sections['n']['total']);
?>
				<?php if ($this->_sections['n']['index'] < 3): ?>
					<tr style="color:red">
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['did']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['title']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['content']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['click']; ?>
</td>
					</tr>
				<?php else: ?>
					<tr>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['did']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['title']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['content']; ?>
</td>
						<td><?php echo $this->_tpl_vars['data'][$this->_sections['n']['index']]['click']; ?>
</td>
					</tr>
				<?php endif; ?>
			<?php endfor; endif; ?>
		</table>
		
		<hr />
		<?php echo ((is_array($_tmp=$this->_tpl_vars['len'])) ? $this->_run_mod_handler('truncate_d', true, $_tmp) : smarty_modifier_truncate_d($_tmp)); ?>

		<hr />
		<?php echo ((is_array($_tmp=$this->_tpl_vars['len'])) ? $this->_run_mod_handler('truncate_d', true, $_tmp, 20) : smarty_modifier_truncate_d($_tmp, 20)); ?>
<!--20为自己定义截取的字符长度-->
		<hr />
		<?php echo ((is_array($_tmp=$this->_tpl_vars['data1'])) ? $this->_run_mod_handler('color', true, $_tmp, 'green') : smarty_modifier_color($_tmp, 'green')); ?>

		
	</body>
</html>